package projetomsn.Client;

/**
 * Classe criada para tratar teclas pressionadas pelo usuário
 * @author HUMBERTO RAMOS
 */
public class Key {

    /**
     * Codigo de cada tecla
     */
    public static final int ESC = 27,
            CTRL = 17,
            ALT = 18,
            BACKSPACE = 8,
            FIXA = 20,
            UP = 38,
            DOWN = 40,
            LEFT = 37,
            RIGHT = 39,
            F1 = 112,
            F12 = 123,
            SHIFT = 16;

    /**
     * Verificar se a tecla pressionada é valida
     * @param keyPressed
     * @return 
     */
    public static boolean isKeyTypedValid(int keyPressed) {
        if (keyPressed != ESC
                && keyPressed != CTRL
                && keyPressed != ALT
                && keyPressed != UP
                && keyPressed != DOWN
                && keyPressed != LEFT
                && keyPressed != RIGHT
                && keyPressed != FIXA) {
            return true;
        } else {
            return false;
        }
    }
}
